<?php
require_once(FWK_CONTROL."ControlDB.class.php");
require_once(FWK_CONTROL."ControlSmarty.class.php");
require_once(FWK_UTIL."Utf8Parsers.class.php");
require_once(FWK_CONTROL."ControlCSS.class.php");
require_once(FWK_CONTROL."ControlJS.class.php");

abstract class AbsComponente{

	private $objBanco;
	private $strValue;
	private $objSmarty;
	private $objJs;
	private $objCss;
	private $style;
	private $class;
	private $name;
	private $id;

	abstract public function getComponente($value = "");

	protected function setValue($value){
		$this->strValue = $value;
	}

	protected function getValue(){
		return $this->strValue;
	}

	protected function getBanco(){
		if($this->objBanco == null)
		$this->objBanco = ControlDB::getBanco();
		return $this->objBanco;
	}

	protected function getObjSmarty(){
		if($this->objSmarty == null)
			$this->objSmarty = ControlSmarty::getSmarty();
		return $this->objSmarty;
	}
	
	protected function getObjJs(){
		if($this->objJs == null)
			$this->objJs = ControlJS::getJS();
		return $this->objJs;
	}
	
	protected function getObjCss(){
		if($this->objCss == null)
			$this->objCss = ControlCSS::getCSS();
		return $this->objCss;
	}

	public function getName(){
		return $this->name;
	}

	public function setName($name=""){
		$this->name = $name;
		self::getObjSmarty()->assign("NAME_COMP",$name);
	}

	public function getClass(){
		return $this->class;
	}

	public function setClass($class=""){
		$this->class = $class;
		if($class != "")
			self::getObjSmarty()->assign("CLASS_COMP","class=\"".$class."\"");
	}

	public function getStyle(){
		return $this->class;
	}

	public function setStyle($style=""){
		$this->style = $style;
		if($style != "")
			self::getObjSmarty()->assign("STYLE_COMP","style=\"".$style."\"");
	}

	public function getId(){
		return $this->id;
	}

	public function setId($id=""){
		$this->id = $id;
		self::getObjSmarty()->assign("ID_COMP",$id);
	}



}